window.workspace = function(){
	var response  = <?#$respons?>;
	var panel, html;
	/********************Begin 前端工作流设计*********************************/
	function mxApplication(config) {
		var editor;
		try {
			if (!mxClient.isBrowserSupported()){
				mxUtils.error('您的浏览器不支持mxGraph', 200, false);
			}else{
				var node = mxUtils.load(config).getDocumentElement();
				editor = new mxEditor(node);
			}
		} catch (e) {
			mxUtils.alert('无法启动应用程序: '+e.message);
			throw e;
		}			
		return editor;
	};
	html = '<div id="graph" style="width:100%;height:100%;overflow:hidden;font-size:8pt;';
	html+= 'white-space:nowrap;border-style:solid;border-color:#F2F2F2;border-width:1px;';
	html+= 'background: url(\''+window.mxBasePath+'/editors-img/grid.gif\');"></div>';
	/********************End 前端工作流设计*********************************/	
 	panel = {
 		title		: response.title+'-'+response.workflow.name,
		html        : html,
		region		: 'center',
		listeners	: {
			'afterrender':function(){
				var xmlinc = window.mxBasePath+'/config/noeditor.xml';
				var editor = new mxApplication(xmlinc);
				var svgxml = response.workflow.svgxml.trim();
				var doc = mxUtils.parseXml(svgxml);
				var node= doc.documentElement;
				if(doc && node) {
					editor.readGraphModel(node);
				}
			}
		}
	};
	return panel;
}();

